-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ Make "go to source definition" work #658
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are all those files intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm in principle
c4c3c86
to
8c272d1
Compare
@@ -25,6 +25,7 @@ export default defineConfig(({ mode }) => { | |||
emitCss: false, | |||
compilerOptions: { | |||
hydratable: true, | |||
// @ts-expect-error to check cc @krampstudio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @krampstudio , apparently the correct type is Omit<ViteOptions, "generate">
, for now bypassed the error (not sure the error is relevant or not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"prepublishOnly": "pnpm run build", | ||
"build": "tsup src/index.ts --format cjs,esm --clean --dts && pnpm run inference-codegen", | ||
"prepublishOnly": "pnpm run inference-codegen && git diff --name-only --exit-code src && pnpm run build", | ||
"build": "tsup src/index.ts --format cjs,esm --clean && tsc --emitDeclarationOnly --declaration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wauplin @SBrandeis I changed the codegen to automatically run in @huggingface/tasks
only during prepublish (publish will error if not up to date)
We would do the same for tgi codegen
It avoids doing it during every pnpm install
but should be done manually before publishing (or maybe we could add a lint check that it's up to date in the Lint
CI)
Going ahead and merging - let me know if any issue arises from it |
is the |
good point, updated |
Sorry for all the codeowners reviews
Make "go to source definition" work by using the package, thanks to
.d.ts.map
files generated bytsc
.Defer type generation to
tsc
instead oftsup
, sincetsup
is not able to generate.d.ts.map
. Also removedshared
package - since we don't want to publish it, having "go to source" with it would have been problematic. Instead, "shared" files are duplicated between@huggingface/inference
and@huggingface/hub
.Maybe later we can create
@huggingface/webblob
and@huggingface/fileblob
if we want to reuse them.See also: https://www.npmjs.com/package/dts-buddy used by svelte-kit